class Solution(object):
    def makeGood(self, s):
        while True:
            t = ''
            n = len(s)
            index = 0
            while index < n - 1:
                if s[index] != s[index + 1] and s[index].lower() == s[index + 1].lower():
                    index += 2
                else:
                    t += s[index]
                    index += 1
            if index < n:
                t += s[index]
            if t == s:
                return t
            else:
                s = t
